package com.spring.demo.springdemo.annotation.conditional.config;


import org.springframework.context.annotation.Condition;
import org.springframework.context.annotation.ConditionContext;
import org.springframework.core.type.AnnotatedTypeMetadata;

/**
 * @Author RenPu
 * @Date 2022/4/8 9:54
 * @Version 1.0
 * @Description:
 **/
public class DefinitionalConfig implements Condition {
    @Override
    public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) {
        if(context.getBeanFactory().containsBean("renPuAspect")){
            return true;
        }
        return false;
    }
}
